<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>作业3</title>
    <script type="text/javascript">
        window.onload = function(){
            var _Text = document.getElementById("myDiv").attributes["lang"].nodeName;
            alert(_Text);
            var _Value = document.getElementById("myDiv").attributes["lang"].nodeValue;
            alert(_Value);
        }
    </script>
</head>
<body>
    <div id="myDiv" class="TextColor" title="文本盒子" lang="zh-on" DIY_Attribute="自己定义的一个属性">这是一个div的内容</div> 
</body>
</html>